package com.haredot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haredot.entity.Order;
import com.haredot.entity.vo.OrderDetail;
import com.haredot.entity.vo.OrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    int queryApplyCount(@Param("applyUserId") Long applyUserId, @Param("applyTime") LocalDateTime applyTime);

    List<OrderVo> findCoffeeListByApplyUserId(@Param("userId") Long userId, @Param("state") Integer state);

    int updateCoffeeOrderByCid(@Param("cid") Long cid, @Param("state") Integer agree);

    OrderDetail findOrderDetail(Long cid);
}
